package com.cn.customer.housekeeping.housekeepingb.ui;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.GridView;

import com.cn.customer.housekeeping.housekeepingb.R;
import com.cn.customer.housekeeping.housekeepingb.bean.BaseResp;
import com.cn.customer.housekeeping.housekeepingb.bean.ProdctBean;
import com.cn.customer.housekeeping.housekeepingb.biz.personcenter.IUserLoginView;
import com.cn.customer.housekeeping.housekeepingb.biz.personcenter.InterfacePresenter;
import com.cn.customer.housekeeping.housekeepingb.ui.adapter.MyGridViewReleaseAdpter;
import com.cn.customer.housekeeping.housekeepingb.ui.base.BaseActivity;
import com.cn.customer.housekeeping.housekeepingb.util.Utils;

import java.util.ArrayList;
import java.util.List;


/***
 *主页===发服务
 */
public class ReleaseListActivity extends BaseActivity implements IUserLoginView {


    private InterfacePresenter mInterfacePresenter;
    private GridView gv_business;
    private List<ProdctBean> listDatas;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_release);
        super.onCreate(savedInstanceState);
    }

    @Override
    public void initViews() {
        mInterfacePresenter = new InterfacePresenter();


        gv_business = (GridView) findViewById(R.id.gv_business);

    }

    @Override
    public void initListeners() {

    }


    @Override
    public void initData() {
        listDatas = new ArrayList<ProdctBean>();
        for (int i = 0; i < 90; i++) {
            listDatas.add(new ProdctBean(""+i, "https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1878573216,1106833289&fm=27&gp=0.jpg"));
        }
        gv_business.setAdapter(new MyGridViewReleaseAdpter(this, listDatas));
    }

    @Override
    public void setHeader() {
        super.setHeader();
        rlTitle.setVisibility(View.VISIBLE);
        ivTopBack.setVisibility(View.GONE);
        tvTopTitle.setText("发布服务");
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
    }

    @Override
    public void onError(BaseResp s) {
        Utils.bequit(s,this);
    }

    @Override
    public void onSuccess(BaseResp s) {

    }

    @Override
    public void showLoading() {
        super.showLoading();
    }

    @Override
    public void hideLoading() {
        super.hideLoading();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
